package com.opencover.xterm;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


public class ColorPair {
	private static final int BACKGROUND_INDEX = 1;
	private static final int FOREGROUND_INDEX = 0;
	private String foreground;
	private String background;
		
	public ColorPair(String... colors)
	{
		this.foreground = colors[FOREGROUND_INDEX];
		this.background = colors[BACKGROUND_INDEX];
	}
	
	public ColorPair(String colors)
	{
		this(StringUtils.split(colors, " "));
	}
	
	public String getForeground() {
		return foreground;
	}
	public void setForeground(String foreground) {
		this.foreground = foreground;
	}
	public String getBackground() {
		return background;
	}
	public void setBackground(String background) {
		this.background = background;
	}
	
	@Override
	public String toString()
	{
		return ReflectionToStringBuilder.toString(this, ToStringStyle.SIMPLE_STYLE);
	}
}
